﻿var express = require('express')
var path = require('path')
var cors = require('cors')
var ejs = require('ejs')
var logger = require('morgan')

var indexRouter = require('./routes/index')

var app = express();

app.engine('html', ejs.__express);
app.set('view engine', 'html');

app.use(cors());
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')));

app.use(indexRouter);

app.listen('3000', () => {
    console.log('按住ctrl点击: http://localhost:3000')
})
